$.extend({
  pajax: async function (option) {
    return await new Promise(function (resolve, reject) {
      option.success = (res) => resolve(res);
      option.error = (res) => reject(res);
      $.ajax(option);
    });
  },
  getParam: function (field) {
    var value = null;
    location.search
      .substring(1)
      .split("&")
      .forEach(function (i) {
        var pair = i.split("=");
        value = pair[0] == field ? pair[1] : value;
      });
    return decodeURIComponent(escape(value));
  },
});
